import Components from './components';
import DcDrop from '@/pages/dnd/right/DcDrop';
import SourceBox from '@/pages/dnd/left/SourceBox';
import React from 'react';

export default function DcItem(props: any) {
  const { item, move } = props;
  const CurrentComponent: any = (Components as any)[item.type];

  return (
    <DcDrop data={item}>
      <SourceBox data={item} onEndDrag={move}>
        <CurrentComponent data={item} move={move} />
      </SourceBox>
    </DcDrop>
  );
}
